import 'package:ladder_cash/generated/json/base/json_convert_content.dart';
import 'package:ladder_cash/app/com/manage/data_upload_manage/data_upload_info.dart';

DataUploadInfo $DataUploadInfoFromJson(Map<String, dynamic> json) {
  final DataUploadInfo dataUploadInfo = DataUploadInfo();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    dataUploadInfo.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    dataUploadInfo.name = name;
  }
  final String? url = jsonConvert.convert<String>(json['url']);
  if (url != null) {
    dataUploadInfo.url = url;
  }
  final dynamic data = json['data'];
  if (data != null) {
    dataUploadInfo.data = data;
  }
  final int? reconnectCount = jsonConvert.convert<int>(json['reconnectCount']);
  if (reconnectCount != null) {
    dataUploadInfo.reconnectCount = reconnectCount;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    dataUploadInfo.status = status;
  }
  return dataUploadInfo;
}

Map<String, dynamic> $DataUploadInfoToJson(DataUploadInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['url'] = entity.url;
  data['data'] = entity.data;
  data['reconnectCount'] = entity.reconnectCount;
  data['status'] = entity.status;
  return data;
}

extension DataUploadInfoExtension on DataUploadInfo {
  DataUploadInfo copyWith({
    int? id,
    String? name,
    String? url,
    dynamic data,
    int? reconnectCount,
    int? status,
  }) {
    return DataUploadInfo()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..url = url ?? this.url
      ..data = data ?? this.data
      ..reconnectCount = reconnectCount ?? this.reconnectCount
      ..status = status ?? this.status;
  }
}